﻿#ifndef CUSTOMCHARTCURVEINFOOBJECT_H
#define CUSTOMCHARTCURVEINFOOBJECT_H

#include <QVector>
#include <QColor>
#include <QString>
#include <QObject>

// 用来往前端传曲线信息

class CustomChartCurveInfoObject : public QObject
{
    Q_OBJECT

public:
    CustomChartCurveInfoObject();

    Q_PROPERTY(double     chartMinX       READ readChartMinX);
    Q_PROPERTY(double     chartMaxX       READ readChartMaxX);
    Q_PROPERTY(double     chartMinY       READ readChartMinY);
    Q_PROPERTY(double     chartMaxY       READ readChartMaxY);

    Q_PROPERTY(QVector<QVector<double>>   pointList       READ readPointList);
    Q_PROPERTY(QVector<QVector<double>>   normPointList   READ readNormPointList);
    Q_PROPERTY(QVector<QVector<double>>   bezierPointList READ readBezierPointList);

    Q_PROPERTY(QVector<int>      curveType    READ readCurveType);
    Q_PROPERTY(QVector<int>      scatterType  READ readScatterType);
    Q_PROPERTY(QVector<int>      lineWidth    READ readLineWidth);
    Q_PROPERTY(QVector<QColor>   color        READ readColor);
    Q_PROPERTY(QVector<int>      curveMinX    READ readCurveMinX);
    Q_PROPERTY(QVector<int>      curveMaxX    READ readCurveMaxX);
    Q_PROPERTY(QVector<int>      curveMinY    READ readCurveMinY);
    Q_PROPERTY(QVector<int>      curveMaxY    READ readCurveMaxY);

    Q_PROPERTY(QVector<double>   tickPercentX   READ readTickPercentX);
    Q_PROPERTY(QVector<double>   tickValueX     READ readTickValueX);
    Q_PROPERTY(QVector<double>   tickPercentY   READ readTickPercentY);
    Q_PROPERTY(QVector<double>   tickValueY     READ readTickValueY);


public:
    double readChartMinX()  const { return _chartMinX; }
    double readChartMinY()  const { return _chartMinY; }
    double readChartMaxX()  const { return _chartMaxX; }
    double readChartMaxY()  const { return _chartMaxY; }

    QVector<QVector<double>>  readPointList()         const { return _pointList; }
    QVector<QVector<double>>  readNormPointList()     const { return _normPointList; }
    QVector<QVector<double>>  readBezierPointList()   const { return _bezierPointList; }

    QVector<int>            readCurveType()       const  { return _curveType; }
    QVector<int>            readScatterType()     const  { return _scatterType; }
    QVector<int>            readLineWidth()       const  { return _lineWidth; }
    QVector<QColor>         readColor()           const  { return _color; }
    QVector<int>            readCurveMinX()       const  { return _curveMinX; }
    QVector<int>            readCurveMaxX()       const  { return _curveMaxX; }
    QVector<int>            readCurveMinY()       const  { return _curveMinY; }
    QVector<int>            readCurveMaxY()       const  { return _curveMaxY; }


    QVector<double>         readTickPercentX()    const  { return _tickPercentX; }
    QVector<double>         readTickValueX()      const  { return _tickValueX; }
    QVector<double>         readTickPercentY()    const  { return _tickPercentY; }
    QVector<double>         readTickValueY()      const  { return _tickValueY; }

    friend class CustomChart;

    void clearAll();

private:

    double      _chartMinX;
    double      _chartMaxX;
    double      _chartMinY;
    double      _chartMaxY;

    // 曲线点
    QVector<QVector<double>>        _pointList;
    QVector<QVector<double>>        _normPointList;
    QVector<QVector<double>>        _bezierPointList;

    // 曲线类型
    QVector<int>                    _curveType;
    QVector<int>                    _scatterType;
    QVector<int>                    _lineWidth;
    QVector<QColor>                 _color;

    // 坐标轴标注
    QVector<double>                 _tickPercentX;
    QVector<double>                 _tickValueX;
    QVector<double>                 _tickPercentY;
    QVector<double>                 _tickValueY;

    // 坐标轴范围（为啥我要记这个来着）
    QVector<int>                    _curveMinX;
    QVector<int>                    _curveMaxX;
    QVector<int>                    _curveMinY;
    QVector<int>                    _curveMaxY;


};

#endif // CUSTOMCHARTCURVEINFOOBJECT_H
